package com.vecspace.middleplatform.filemanagment.model;

import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;

public class FileAccessLog {
	private int date;
	private int minuteTick;
	private AtomicInteger accessTimes = new AtomicInteger(0);
	private AtomicLong fileBytes = new AtomicLong();
	public int getDate() {
		return date;
	}
	public void setDate(int date) {
		this.date = date;
	}
	public int getMinuteTick() {
		return minuteTick;
	}
	public void setMinuteTick(int minuteTick) {
		this.minuteTick = minuteTick;
	}
	public int getAccessTimes() {
		return accessTimes.get();
	}
	
	public long getFileBytes() {
		return fileBytes.get();
	}
	
	public void incAccessTimes() {
		accessTimes.addAndGet(1);
	}
	
	public void addFileBytes(long bytes) {
		fileBytes.addAndGet(bytes);
	}
	
	public boolean equals(int date, int minuteTick) {
		return this.date == date && this.minuteTick == minuteTick;
	}
}
